package com.zhuoyue.system.service.impl;

import java.util.List;

import com.zhuoyue.system.domain.po.TblSecurityLogPo;
import com.zhuoyue.system.domain.vo.TblSecurityLogVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhuoyue.system.mapper.TblSecurityLogMapper;
import com.zhuoyue.system.domain.TblSecurityLog;
import com.zhuoyue.system.service.ITblSecurityLogService;

/**
 * logService业务层处理
 *
 * @author hewenze
 * @date 2020-08-11
 */
@Service
//@DataSource(SLAVE1)
public class TblSecurityLogServiceImpl implements ITblSecurityLogService {
    @Autowired
    private TblSecurityLogMapper tblSecurityLogMapper;


    /**
     * 查询log列表
     *
     * @param //tblSecurityLog log
     * @return log
     */
    @Override

    public List<TblSecurityLogVo> selectTblSecurityLogList(TblSecurityLogPo tblSecurityLogPo) {
        return tblSecurityLogMapper.selectTblSecurityLogList(tblSecurityLogPo);
    }

    @Override
    public List<TblSecurityLog> selectByTime(String orgCode, String account, String gatewayMac, String deviceMac, String start, String end, Integer pageNum, Integer pageSize) {

        //查询数据库表名
        List<String> tableList = this.tblSecurityLogMapper.selectTableName();


        List<TblSecurityLog> tblSecurityLogs = this.tblSecurityLogMapper.selectByTime(tableList, orgCode, account, gatewayMac, deviceMac, start, end, pageNum, pageSize);
        //System.out.println(tblSecurityLogs);

        return tblSecurityLogs;
    }

    @Override
    public Integer selectByTimeCount(String orgCode, String account, String gatewayMac, String deviceMac, String start, String end) {

        //查询数据库表名
        List<String> tableList = this.tblSecurityLogMapper.selectTableName();


        Integer integer = this.tblSecurityLogMapper.selectByTimeCount(tableList, orgCode, account, gatewayMac, deviceMac, start, end);


        return integer;
    }
}
